
#include <BState>
#include "member_BState.h"

using namespace BWE;

#define member					(*(member_BState*)_ptr)
#define member_allocate()		_ptr = new member_BState
#define member_release()		delete (member_BState*)_ptr

BState::BState()
{
	member_allocate();
}
BState::~BState()
{
	member_release();
}

void BState::setCullBack(bool cullBackface)
{
	member.cullBackface = cullBackface;
}
bool BState::cullBackface() const
{
	return member.cullBackface;
}

void BState::setLighting(bool lighting)
{
	member.lighting = lighting;
}
bool BState::lighting() const
{
	return member.lighting;
}

void BState::setDepthTest(bool depthTest)
{
	member.depthTest = depthTest;
}
bool BState::depthTest() const
{
	return member.depthTest;
}

void BState::setLineSmooth(bool lineSmooth)
{
	member.lineSmooth = lineSmooth;
}
bool BState::lineSmooth() const
{
	return member.lineSmooth;
}

void BState::setPolygonSmooth(bool polygonSmooth)
{
	member.polygonSmooth = polygonSmooth;
}
bool BState::polygonSmooth() const
{
	return member.polygonSmooth;
}

void BState::setLineWidth(int lineWidth)
{
	if(lineWidth <= 0)
		lineWidth = 1;
	member.lineWidth = lineWidth;
}
int BState::lineWidth() const
{
	return member.lineWidth;
}

void BState::setNormalize(bool normalize)
{
	member.normalize = normalize;
}
bool BState::normalize() const
{
	return member.normalize;
}

void BState::setPointSmooth(bool pointSmooth)
{
	member.pointSmooth = pointSmooth;
}
bool BState::pointSmooth() const
{
	return member.pointSmooth;
}

void BState::setPointSize(int pointSize)
{
	if(pointSize <= 0)
		pointSize = 1;
	member.pointSize = pointSize;
}
int BState::pointSize() const
{
	return member.pointSize;
}

void BState::setPolygonMode(PolygonMode polygonMode)
{
	member.polygonMode = polygonMode;
}
PolygonMode BState::polygonMode() const
{
	return (PolygonMode)member.polygonMode;
}
